From: Bob Rogers Date: Sun, 10 Jul 2011 01:42:39 +0000 (-0400) Subject: * vc/vc.el (vc-diff-internal): Fix race condition (Bug#1256). X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~2979 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=72cfc094f0a604295f0c507c29375d8bb1d8f2e8;p=emacs.git * vc/vc.el (vc-diff-internal): Fix race condition (Bug#1256). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cea690723df..6fa23da774a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2011-07-10 Bob Rogers + + * vc/vc.el (vc-diff-internal): Fix race condition (Bug#1256). + 2011-07-10 Chong Yidong * window.el (display-buffer): Fix arguments to diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index e3f3c153043..796311f8f66 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1605,10 +1605,13 @@ Return t if the buffer had changes, nil otherwise." ;; bindings are nicer for read only buffers. pcl-cvs does the ;; same thing. (setq buffer-read-only t) - (vc-exec-after `(vc-diff-finish ,(current-buffer) ',(when verbose - messages))) ;; Display the buffer, but at the end because it can change point. (pop-to-buffer (current-buffer)) + ;; The diff process may finish early, so call `vc-diff-finish' + ;; after `pop-to-buffer'; the former assumes the diff buffer is + ;; shown in some window. + (vc-exec-after `(vc-diff-finish ,(current-buffer) + ',(when verbose messages))) ;; In the async case, we return t even if there are no differences ;; because we don't know that yet. t)))